Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make output buffer for STM32 DAC configurable #57730

Conversation

benediktibk
Copy link
Collaborator

If an operational amplifier is used on the DAC output it is preferrable to disable the DAC output buffer.

@benediktibk benediktibk force-pushed the disable_stm32_dac_output_buffer branch from 3b25149 to 33d7951 Compare May 10, 2023 06:56
@benediktibk benediktibk marked this pull request as ready for review May 10, 2023 08:08
@zephyrbot zephyrbot added platform: STM32 ST Micro STM32 area: DAC Digital-to-Analog Converter area: Devicetree Binding PR modifies or adds a Device Tree binding labels May 10, 2023
@benediktibk
Copy link
Collaborator Author

Btw, I'm uncertain if this is the best approach. Would it be preferrable to deactivate the output buffer on a channel basis?

@martinjaeger
Copy link
Member

Hi @benediktibk and thanks for your contribution.

I looked through the STM32 reference manuals. The buffer really seems to be a channel property. So I'd suggest to add another member bool buffered to the struct dac_channel_cfg. Please mention in the Doxygen comments that this property is hardware dependent.

As the default would now be unbuffered if the member is not explicitly set to true , some existing code might break. I will make sure to add this to the release notes, so that users are aware of this change.

@benediktibk benediktibk force-pushed the disable_stm32_dac_output_buffer branch from 33d7951 to 73c07d3 Compare May 16, 2023 12:00
@benediktibk benediktibk requested a review from nashif as a code owner May 16, 2023 12:00
@zephyrbot zephyrbot added the Release Notes To be mentioned in the release notes label May 16, 2023
@zephyrbot zephyrbot requested a review from jgl-meta May 16, 2023 12:00
@benediktibk benediktibk force-pushed the disable_stm32_dac_output_buffer branch from 73c07d3 to f50449a Compare May 16, 2023 12:03
Copy link
Member

@martinjaeger martinjaeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick update and that you've already updated the release notes.

May I ask you to move the note up a little bit into the Changes in this release section, as the DAC API is still experimental and not a stable API, yet.

After that it's ready to go from my side.

If an operational amplifier is used on the DAC output it is
preferrable to disable the DAC output buffer.

Signed-off-by: Benedikt Schmidt <[email protected]>
@benediktibk benediktibk force-pushed the disable_stm32_dac_output_buffer branch from f50449a to 11c0d48 Compare May 23, 2023 08:56
@benediktibk
Copy link
Collaborator Author

Thanks for the quick update and that you've already updated the release notes.

May I ask you to move the note up a little bit into the Changes in this release section, as the DAC API is still experimental and not a stable API, yet.

After that it's ready to go from my side.

done

@zephyrbot zephyrbot requested a review from Desvauxm-st May 23, 2023 08:56
@carlescufi carlescufi merged commit 940ddba into zephyrproject-rtos:main May 23, 2023
FRASTM added a commit to FRASTM/zephyr that referenced this pull request Jun 7, 2023
Add the '.buffered' field to the dac_channel_cfg structure
when testing the DAC.
This boolean parameter is initialised to 'true' to PASS the test.
It follows the zephyrproject-rtos#57730

Signed-off-by: Francois Ramu <[email protected]>
FRASTM added a commit to FRASTM/zephyr that referenced this pull request Jun 7, 2023
Add the '.buffered' field to the dac_channel_cfg structure
when testing the DAC.
This boolean parameter is initialised to 'true' to PASS the test.
It follows the zephyrproject-rtos#57730
Also changed for the samples/drivers/dac

Signed-off-by: Francois Ramu <[email protected]>
nashif pushed a commit that referenced this pull request Jun 8, 2023
Add the '.buffered' field to the dac_channel_cfg structure
when testing the DAC.
This boolean parameter is initialised to 'true' to PASS the test.
It follows the #57730
Also changed for the samples/drivers/dac

Signed-off-by: Francois Ramu <[email protected]>
coreboot-org-bot pushed a commit to coreboot/zephyr-cros that referenced this pull request Jun 9, 2023
Add the '.buffered' field to the dac_channel_cfg structure
when testing the DAC.
This boolean parameter is initialised to 'true' to PASS the test.
It follows the zephyrproject-rtos/zephyr#57730
Also changed for the samples/drivers/dac

(cherry picked from commit c908aea)

Original-Signed-off-by: Francois Ramu <[email protected]>
GitOrigin-RevId: c908aea
Change-Id: I282794e70ca141a90b802a0ba23a4265107ca40f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4603286
Tested-by: CopyBot Service Account <[email protected]>
Reviewed-by: Al Semjonovs <[email protected]>
Commit-Queue: Al Semjonovs <[email protected]>
Tested-by: Al Semjonovs <[email protected]>
hlord2000 pushed a commit to hlord2000/zephyr that referenced this pull request Jul 3, 2023
Add the '.buffered' field to the dac_channel_cfg structure
when testing the DAC.
This boolean parameter is initialised to 'true' to PASS the test.
It follows the zephyrproject-rtos#57730
Also changed for the samples/drivers/dac

Signed-off-by: Francois Ramu <[email protected]>
@benediktibk benediktibk deleted the disable_stm32_dac_output_buffer branch July 5, 2023 09:35
@rjmaris
Copy link

rjmaris commented Sep 21, 2023

This modification came (for me) to the right time. I have just been starting to test a next prototype iteration (while updating to Zephyr 3.4) where an opamp buffer is included. The buffer is included after I discovered that the built-in buffer never goes below 0.15V (even on a little load to GND). It worked right from the start, because of the new disabled state default. Also afterwards I reviewed the electrical DAC specs.

BTW this little change makes it easier to obtain an understanding of interaction of zephyr driver code with the STM32 hal code.

matthew-morgan-molex added a commit to matthew-morgan-molex/zephyr that referenced this pull request Oct 4, 2023
* Bluetooth: ATT: Add documentation for ATT error codes

Add the description of each error code as defined by the
core spec and the CSS.

Signed-off-by: Emil Gydesen <[email protected]>

* net: lwm2m: Fix lwm2m_socket_start() error handling

In case lwm2m_socket_start() internal error, it should only do cleanup
on the socket, i. e. call lwm2m_socket_close(), not lwm2m_engine_stop().
The latter resets the entire lwm2m_context, which results in removal of
active observations.

This should not be done, as it collides with the RD client logic, where
connection resumption may skip the full registration phase, in result
not notifying the server that it should restart the observations.

At the same time, the RD client should clean the lwm2m_context when it's
done trying to update the registration and proceeds with regular
registration/bootstrap in the network error handler. In that case, only
the socket was closed, so the lwm2m_context needs to be reset
separately.

Signed-off-by: Robert Lubos <[email protected]>

* drivers: gpio: fxl6408: Fix Kconfig dependency for log level config

This makes Kconfig logging options for this driver depending on whether
the driver is enabled or not.

Signed-off-by: Caspar Friedrich <[email protected]>

* include: sys: util_macro: Add UTIL_INC/DEC/X2

Add UTIL_INC, UTIL_DEC and UTIL_X2 macros

Signed-off-by: Erwan Gouriou <[email protected]>

* drivers: interrupt_controller: Use macros to access line_range prop values

Compiling previous code using LLVM reveals that accessing line_range
values in runtime is not clean, as the following error is generated:
"error: initializer element is not a compile-time constant"

Replace runtime method by compile time using UTIL_INC and UTIL_x2
macros.

Signed-off-by: Erwan Gouriou <[email protected]>

* Bluetooth: controller: Release SDU as missing if RX only unf. padding

Based on interpretation of Clarification Errata ES-22876 Request for
Clarification - Recombination actions when only padding unframed PDUs
are received, it was decided that an SDU should be released as "Missing"
when only padding PDUs are received for any SDU.
- https://bluetooth.atlassian.net/browse/ES-22876

This change will also assist streaming in the Common Central design
where the central was found to send only padding PDUs before streaming
starts.

Signed-off-by: Nirosharn Amarasinghe <[email protected]>

* tests: bluetooth: controller: Release SDU as missing RX unf. padding

Testing:
-- Receiving only padding PDUs for an SDU
-- Receiving leading padding PDUs (not an expected use case)

Signed-off-by: Nirosharn Amarasinghe <[email protected]>

* Bluetooth: controller: fix time-wrapping of cig_ref_point

Time wrapping was omitted at some points. These were corrected or
clarified.

Signed-off-by: Nirosharn Amarasinghe <[email protected]>

* Bluetooth: controller: Release missing / lost SDUs for framed PDUs

-- Implemented reporting of lost / missing SDUs for framed PDUs. This
   should result in SDUs being released when only framed padding PDUs or
   error PDUs are received.
-- Removed unused configuration params structure, storage and linked
   APIs.
-- Reduced default logging level to INF instead of DBG.
-- Included debug logging messaged for framed consumption.
-- Removed separate latency_unframed and latency_framed and replaced
   with a common sdu_sync_const as they are mutually exclusive for each
   sink.
-- Restricted framed time stamp calculation only to situations where all
   dependent information is available.
-- Corrected SDU sequence numbering to release starting at zero.

Signed-off-by: Nirosharn Amarasinghe <[email protected]>

* tests: Bluetooth: controller: updated ISO-AL tests for lost SDUs

-- Updated test cases to include missing / lost SDUs.
-- Included tests for receiving only framed padding PDUs.
-- Removed tests linked to sink and source configuration params as these
   were unused and removed.

Signed-off-by: Nirosharn Amarasinghe <[email protected]>

* ci: Fix setup of ccache in twister workflow

Path for cache directory has changed, adapt workflow accordingly.

Signed-off-by: Anas Nashif <[email protected]>

* board: arm: black_f407ve: fix uart1 default pinmux and console uart

This board as a dedicated console serial header right next to
the stlink connector. This serial header is connected to usart1.

This patch fixes the pinmux for usart1 and makes it the default
console serial port.

Signed-off-by: Sahaj Sarup <[email protected]>

* board: arm: black_f407ve: add dfu programming support

This board has boot mode pins, 5 and 6 on the J3 header, that
puts the board into dfu mode.

This patch adds that as a supported flashing config, default still
remains openocd with jlink.

Signed-off-by: Sahaj Sarup <[email protected]>

* net: lwm2m: Allow overiding of default socket behaviour

In order to support external IP stacks that might have Connection
ID support, the LwM2M engine should allow client to bypass default
behaviour.

New set_socketoptions() callback added into client context
that allows overriding all socket opetions. This is called
after a socket is opened, but before the connect() is
called. This cannot be combined with load_credentials() callback
on all platforms as for example nRF91 requires modem offline
when credentials are written. This would cause socket to be closed
as well.

Second change is that we allow fine tuning of what we do with
socket handle when QUEUE mode is enabled and engine enters idle
state.

First option would be to close the socket. That would cause
TLS Alert(Close Notify) to be send. This is a band choice if
LTE modem was already in PSM or eDRX power saving mode.

Second option would be to delay socket closing until we
are going to send LwM2M update. There TLS Alert is also send,
but most probably lost due to NAT mapping timed out. This
is a best choice for LTE modem with DTL session cache enabled.

Two new options are to keep socket open, and either stop listening
or just keep listening. Both of these options work fine when
we have DTLS Connection ID support.

Signed-off-by: Seppo Takalo <[email protected]>

* net: tcp: populate context's local address for incoming connections

`local_addr` would only be initialized if `context->local->sin*_addr` was
non-null. However, since `context` is a fresh context object, `local_addr`
always remains at its initial value of `INADDR_ANY`, which is propagated to
the context by `net_context_bind()`.

By populating `local_addr` using the TCP endpoint, `getsockname()` now
returns the correct local address.

Signed-off-by: Armin Brauns <[email protected]>

* net: mqtt-sn: fix port in mqtt-sn debug message

The port we are connecting to is stored in network byte order,
thus, we need to convert it to the CPU's byte order before logging

Signed-off-by: Mark Oude Elberink <[email protected]>

* drivers: intc: stm32: use BIT macro with type cast argument

1. use 'BIT' macro instead of explicit left shift operations, since
'BIT' macro implicitly adds unsigned type suffix, avoiding possible
[shiftTooManyBitsSigned] scenarios, and

2. add an explicit uint32_t cast to 'BIT' macro argument, complying with
required [misra-c2012-10.1] rule which states; operands shall not be of
an inappropriate essential type.

Found as a coding guideline violation (Rule 10.1) by static code
scanning tool.

Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).

Signed-off-by: ferar alashkar <[email protected]>

* drivers: intc: stm32: add break to switch-clause

add an unconditional break to switch-clause's default case, complying
with required [misra-c2012-16.3] rule which states; An unconditional
break statement terminate every switch-clause.

Found as a coding guideline violation (Rule 16.3) by static code
scanning tool.

Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).

Signed-off-by: ferar alashkar <[email protected]>

* Bluetooth: audio: tbs_client: Fix possible override of GATT read parameters

This fixes missing guard access to GATT read parameters.
The code checks `busy` flag and returns an error in case there's ongoing
GATT Read operation already.

Fixes: #58425
Signed-off-by: Mariusz Skamra <[email protected]>

* Bluetooth: audio: tbs_client: Fix missing cleanup

This fixes repeated attempt to bt_tbs_client_discover that failed
because srv_inst->current_inst was not cleared during previous discovery
process. The issue seen in case the GATT Read CCID returned an error.
The code has been factored out to separate helper function.

Signed-off-by: Mariusz Skamra <[email protected]>

* Bluetooth: audio: tbs_client: Remove GATT subscriptions upon disconnection

As long as we do not have NVS support in TBS, the subscriptions shall be
removed once ACL is disconnected to avoid potential crash on
reconnection, as the subscription parameters might be not valid anymore.

Signed-off-by: Mariusz Skamra <[email protected]>

* net: tcp: Fix possible double TCP context dereferencing

In case TCP connection is being closed from the TCP stack, due to for
instance retransmission timeout, the stack should also switch the TCP
state to CLOSED. Otherwise, there was a risk of dereferencing the TCP
context twice, for example if the application was in active socket
send(), and tried to reschedule data transmission.

Additionally, make sure that the TCP_CLOSED state handling is a no-op
state - otherwise, there is a risk that if packets keep incoming before
the application dereferences the TCP context on its side, TCP stack
will incorrectly dereference the context for the second time from
within due to current TCP_CLOSED state logic.

Signed-off-by: Robert Lubos <[email protected]>

* samples: usb: mass: Set next stack max LUNs to 3

Mass storage sample contains separate Kconfig options for RAM, Flash and
SDMMC disk drivers. All disk drivers can be enabled simultaneously and
therefore the maximum number of concurrent LUNs is 3.

Configure Mass Storage class maximum LUNs to 3 to solve initialization
failures on targets that enable more than one disk driver at a time.
Each additional supported LUN increases the Mass Storage class memory
usage by 48 bytes (struct scsi_ctx) on 32-bit targets. Allocating 3 SCSI
context structures allows the sample to work regardless what disk
drivers are concurrently enabled.

Fixes: #57657

Signed-off-by: Tomasz Moń <[email protected]>

* ci: workflows: create cache directory for ccache

Create cache directory before moving ccache.

Signed-off-by: Anas Nashif <[email protected]>

* soc/intel_adsp: fix typo in L1EXP definition

The field offset is incorrect, L1EXP is at bit 24 and L1ETP at bit 25.

Fixes: cc6e9c094aac ("soc/intel_adsp: Low level HDA driver and tests")
Signed-off-by: Pierre-Louis Bossart <[email protected]>

* boards: arm: kv260_r5: doc: update board documentation

By adding the link to an openAMP project reference
Linux image targeted to the kv260 board which comes
with openAMP support and remoteproc endpoints.

Signed-off-by: Felipe Neves <[email protected]>

* dts: mec172x: move the uart device node off espi

Move the two UART nodes so that they are under "soc" rather than "espi",
leave only xec-espi-host-dev nodes there.

The UART device can be used indepdently by the driver uart_mchp_xec.c
and it's normally initialized before before the espi one.

Moving the device node up a level so this does not trigger a false
positive on the build time priority checking.

Signed-off-by: Fabio Baltieri <[email protected]>

* doc: develop: api: overview: tag Task Watchdog API as Unstable

Promote Task Watchdog API from Experimental to Unstable.

The API has proven to be suitable for its purpose.

Signed-off-by: Martin Jäger <[email protected]>

* doc: develop: api: overview: tag DAC API as Unstable

Promote DAC API from Experimental to Unstable.

The API is well adopted and used in more than 2 implementations.

Signed-off-by: Martin Jäger <[email protected]>

* drivers: intc: stm32: clarify controlling expression

add explicit boolean type to 'if' statement controlling expression,
consolidating it with 'stm32_exti_is_pending' function return type, thus
improving code readability and maintainability, complying with required
[misra-c2012-14.4] rule which states; The controlling expression of an
if statement and the controlling expression of an iteration-statement
shall have essentially boolean type.

Found as a coding guideline violation (Rule 14.4) by static code
scanning tool.

Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).

Signed-off-by: ferar alashkar <[email protected]>

* doc: release-notes: fix bad links

Added missing include/ to fix dead links re: iterable sections API

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: update LittleFS Github repo URLs

LittleFS now lives in the littlefs-project GH organization.

Signed-off-by: Benjamin Cabé <[email protected]>

* boards: doc: fix stale blackpill repo URL

Updated GitHub links to point to active repos.

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: update stale srecord links

Updated 404 links to point to valid locations.

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: update stale links to MCUboot documentation

mcuboot.com/documentation --> docs.mcuboot.com

Signed-off-by: Benjamin Cabé <[email protected]>

* samples: doc: fix dead links

Fixed deadlinks reported by Sphinx linkchecker

Signed-off-by: Benjamin Cabé <[email protected]>

* boards: doc: fix dead links

Fixed various dead links reported by Sphinx linkchecker, from typos to
moved datasheets / technical documentations.

Signed-off-by: Benjamin Cabé <[email protected]>

* west: doc: update link to SPDX doc

fixed 404 link to SPDX documentation

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: snippets: fix bad link

Fixed incorrect reference to snippets/ folder

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: peripherals:  fix bad link to Display API

fixed incorrect link reference to Display API

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: i2c: fixed non-working link to I2C spec

Fixed improperly formatted link to I2C spec.

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: mcumgr: update link to mcumgr root folder

MCUmgr does not live in subsys/mgmt/mcumgr/lib anymore.

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: pinctrl: fix link to ELC2021 slide deck

updated link to point to a working location.

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: fixed stale link to sbs emulator

Fixed bad link reported by Sphinx linkchecker

Signed-off-by: Benjamin Cabé <[email protected]>

* doc: spi: fix doxygen comment for MISO Lines doc

Update SPI MISO Lines documentation to remove incorrect use of @kconfig.
Fixes #58912.

Signed-off-by: Benjamin Cabé <[email protected]>

* rp2040: Fix USB self powered for all boards

The USB configuration for all rp2040 boards wrongfully left
USB_SELF_POWERED as true by default. This commit fixes it for
all rp2040 boards.

Fixes #53993

Signed-off-by: Yonatan Schachter <[email protected]>

* tests: mcumgr: update tags

add mcumgr as a tag for mcumgr tests.

Signed-off-by: Anas Nashif <[email protected]>

* test: ARC: skip div-by-zero test in case of SW div implementation

The SW div implementation from libgcc doesn't handle division by
zero case, so the HW exception isn't triggered.

So, skip this test case (as we are already doing for some other
ARC targets).

Signed-off-by: Eugeniy Paltsev <[email protected]>
Signed-off-by: Evgeniy Paltsev <[email protected]>

* drivers: regulator: pca9420: fix support for DVS modes

Fix support for DVS modes, as the dvs_state_set implementation
previously had the mask and value parameters in the
i2c_reg_update_byte_dt function swapped.

Also, record the active DVS state and update the voltage get/set and
regulator enable/disable function to target the active DVS mode. This
will enable a user to configure multiple run modes, and modify target
voltages for those modes when in the new mode. When a user is utilizing
the MODESEL pins, update the active state but return an error so that
the application can still edit settings for the new DVS mode once it has
reconfigured the appropriate pins.

Signed-off-by: Daniel DeGrasse <[email protected]>

* net: lib: coap: Fixed unchecked send return value in CoAP client

The retransmission attempt in CoAP client library did not verify the
send result.

Signed-off-by: Robert Lubos <[email protected]>

* net: lwm2m: Fix possible out-of-bound access when creating FW object

obj_inst_id should not be used directly to index the instance array, as
the instance ID is not tightly bound to the maximum instance count and
can exceed this value, causing out-of-bound access.

Therefore, perform some extra validation when choosing the array index
for the object instance to make sure we stay in the array bounds, or
return an error if there's no more room for more object instances, in a
similar way it's done for Security object.

Signed-off-by: Robert Lubos <[email protected]>

* net: lwm2m: Fix pointless variable assignment

Coverity reported that assigning ret = 0 is pointless, as in any
scenario (loop continues or ends) the ret variable is overwritten
anyway, w/o using the assigned value. Therefore remove the needless
assignment.

Signed-off-by: Robert Lubos <[email protected]>

* net: websockets: Fix implicit type conversion Coverity warning

Coverity reported potential issues with implicit signed/unsigned type
conversions and potential problems with this. Fix this, by casing the
byte-shifted data variable to uint64_t type explicitly.

Signed-off-by: Robert Lubos <[email protected]>

* net: ieee802154_mgmt: Fix memcpy to uninitialized pointer location

As since commit bff6a5c, params.dst.ext_addr is no longer assigned with
the ctx->coord_ext_addr pointer, but a endianness swap is included, it
should be assigned with a proper buffer before the memcpy.

Signed-off-by: Robert Lubos <[email protected]>

* doc: add a section about coverity scans

Quick intro into static code analysis and scans.

Signed-off-by: Anas Nashif <[email protected]>

* drivers: dma_mcux_lpc: Fix potential NULL pointer dereferences

Dereference variables after NULL checking.

Signed-off-by: Jacob Siverskog <[email protected]>

* fs/littlefs/sample: Increase stack size

Increase stack size to prevent sample crashes.

Fixes #57525

Signed-off-by: Dominik Ermel <[email protected]>

* Bluetooth: Samples: Remove usage of `BT_DEBUG_LOG`

Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from samples. It
has been deprecated since this PR:
https://github.com/zephyrproject-rtos/zephyr/pull/56183

The Kconfig symbols has been replaced by `CONFIG_LOG=y` on most of the
cases. Or it has been removed when not needed anymore.

Signed-off-by: Théo Battrel <[email protected]>

* Bluetooth: Tests: Remove usage of `BT_DEBUG_LOG`

Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from tests. It has
been deprecated since this PR:
https://github.com/zephyrproject-rtos/zephyr/pull/56183

The Kconfig symbols has been replaced by `CONFIG_LOG=y` on most of the
cases. Or it has been removed when not needed anymore.

Signed-off-by: Théo Battrel <[email protected]>

* Bluetooth: Documentation: Remove reference to `BT_DEBUG_LOG`

Remove reference to deprecated Kconfig symbol `CONFIG_BT_DEBUG_LOG` in
the documentation.

Signed-off-by: Théo Battrel <[email protected]>

* samples: drivers: peci: Exclude MEC172x EVB from test

PECI bus sample requires a controller and a target
Intel system(PECI controller) + Embedded controller(PECI target),
where EC HW can be add-on card (mec172xmodular) or onboard EC.

MEC172x EVB is not intended to be connected hence excluding
the platform.

Signed-off-by: Jose Alberto Meza <[email protected]>

* boards: mec172xmodular_assy6930: Correct EC bootloader settings

Changing the EC ROM bootloader mode to Quad from Dual and
SPI drivestrength to 8mA
This changes are required because of the different SPI flash
used which doesn't support Dual mode.

Signed-off-by: Jose Alberto Meza <[email protected]>

* Bluetooth: samples: ISO: Check validity of incoming data

Only print incoming data when the data is valid. Otherwise we also
print incoming data when no data was received.

Signed-off-by: Rubin Gerritsen <[email protected]>

* Bluetooth: samples: central_iso: Unref if send fails

Fixes a resource leak.

Signed-off-by: Rubin Gerritsen <[email protected]>

* include: zephyr: drivers: ps2: Add missing err codes header

Fix compilation error when enabling PS2 driver and userspace.

Signed-off-by: Jose Alberto Meza <[email protected]>

* net: context: Fix ambigous pointer check in net_context_connect()

Coverity reported, that laddr pointer used in net_context_connect()
could be passed as NULL to net_tcp_connect() where it could be
dereferenced. This is because the actual setting of laddr to a valid
address structure was only done after
net_sin/sin6_ptr(&context->local)->sin/sin6_addr verification.

In practice though, the aforementioned pointer verification would always
pass, as the bind_default() guarantee that the context->local address is
set to an unspecified address (if it hasn't been set earlier).

Therefore refactor the code a bit: replace the pointer verification
with NET_ASSERT - only to assure that we can catch regression in case
for any reason the behavior of bind_default() changes. This should also
ensure that Coverity no longer reports that laddr is NULL when reaching
net_tcp_connect().

Signed-off-by: Robert Lubos <[email protected]>

* Bluetooth: Mesh: Fix unable sent mesh message

In PR (#58723) has introduce another bug, that,
the flag ADV_FLAG_PROXY set before actually enabled.

When ctx:: BT RX call schedule_send will atomic_test_and_clear
ADV_FLAG_PROXY, but at this time, the proxy advertising will
not at advertising state, maybe in update params or set adverting
data phase,

so that, call bt_le_ext_adv_stop will nothing, and then call
k_work_reschedule --> send_pending_adv(at this time, the proxy
advertising actually enabled, but the upper layer clear proxy flags),
cause latest advertising unable start, because unable in advertising
state to update params(-EINVAL).

Fixes: #58721

Signed-off-by: Lingao Meng <[email protected]>

* doc: api: Update status for auxdisplay API

auxdisplay API was introduced in 3.4, not 3.3.
Also update to "experimental" status to better reflect that the API is
new.

Signed-off-by: Benjamin Cabé <[email protected]>

* Bluetooth: Tests: Check CCC Update

Check that if a bonded peer subscribed to a CCC, a non-bonded peer with
the same address cannot update the CCC.

Signed-off-by: Théo Battrel <[email protected]>

* Bluetooth: Host: Fix GATT server handling of CCC

GATT server was not doing enough check before udpating the CCC.

For example, a non-bonded client could update the CCC of a bonded client
by spoofing his address.

This fix the issue by dissociating the CCC configuration of a bonded and
a non-bonded peer. To do that, a new field is added to the CCC config:
`link_encrypted`.

Signed-off-by: Théo Battrel <[email protected]>

* Bluetooth: Mesh: Avoid undefined behavior in bit shift in blob_cli.c

block_size_log can be 0x20 which will shift 1 by 32 bits which will
cause undefined behavior. Adding ULL to 1 is an option but this will add
little bit more code when debug option is enabled. So simply print the
logarithmic value.

Coverity-ID: 316387
Fixes #58951

Signed-off-by: Pavel Vasilyev <[email protected]>

* Bluetooth: Controller: Fix ISOAL sink create role for ISO Receiver

Fix ISOAL sink create role for ISO Receiver.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* doc: api: Promote EDAC API as Unstable

Promote Error Detection And Correction (EDAC) API as Unstable.

Fixes: #58487

Signed-off-by: Andrei Emeltchenko <[email protected]>

* samples: Bluetooth: unicast audio client and server overlay config

Add Zephyr Bluetooth Low Energy Controller overlay config for
the unicast audio client and server samples.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* Bluetooth: Controller: Fix Tx ISO SDUs dropped due to strict SN check

Introduce a Kconfig BT_CTLR_ISOAL_SN_STRICT to relax the Tx
ISO Data SDUs being dropped due to strict check of sequence
numbers in ISOAL, i.e. dropped when ISO Data SDUs are
delayed from upper layer with respect to the current
payload number in the ISO radio events.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* samples: Bluetooth: Relax Tx ISO SDUs dropped in unicast audio samples

Relax Tx ISO SDUs being dropped in unicast audio client and
server samples when using the Zephyr Bluetooth Low Energy
Controller, i.e. Tx ISO SDUs dropped due to delayed ISO data
send calls in upper layer with respect to payload number in
the current ISO radio events in the Controller.

This option is disabled in the sample and users can use it
when need be.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* samples: Bluetooth: Fix Tx ISO Data packet sequence number

Fix Tx ISO Data packet sequence number increment based on
the send timer timeout value.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* Bluetooth: Controller: Update BT_CTLR_ISOAL_SN_STRICT help text

Update BT_CTLR_ISOAL_SN_STRICT help text.

Co-authored-by: Nirosharn Amarasinghe <[email protected]>
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* tests: bsim: Bluetooth: Fix BIS test ISO Tx Buffers in Controller

Fix BIS test for ISO Tx Buffers in Controller to be 2 for
ISO TX MTU size of 502 bytes.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* Bluetooth: Controller: Fix Broadcast ISO interval unit

Fix incorrectly stored Broadcast ISO interval in
microseconds instead of storing in 1.25 ms units.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* Bluetooth: Controller: Fix read ISO Tx Sync for Broadcast ISO

Fix missing read ISO Tx Sync for Broadcast ISO feature.

Co-authored-by: Nirosharn Amarasinghe <[email protected]>
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* sysbuild: ensure warning is only printed when VAR is not used

When calling `sysbuild_get(<out-var> VAR <lookup-var> ...)` user
specifically specify the output variable and in such cases the overwrite
warning should not be printed, because such invocation is similar to a
regular `set(<var> <val>)` CMake call.

Only the invocation where the same variable name is used for lookup and
return variable, then the warning must be printed to avoid unintentional
overwriting of existing variables.

Signed-off-by: Torsten Rasmussen <[email protected]>

* tests: drivers: can: api: fix test_set_timing_data_while_started test

Change the test_set_timing_data_while_started test to actually attempt to
set the data phase timing parameters instead of attempting to set the
nominal/arbitration timing parameters.

Update test descriptions to explicitly mention data phase timing.

Fixes: #59046

Signed-off-by: Henrik Brix Andersen <[email protected]>

* Bluetooth: Controller: Fix cis_offset_min to have additional margin

As the coarse tick of ACL prepare and CIG prepare jitter by
+/- 1 tick, hence when initially scheduling the CIG place it
with enough margin so that cis_offset_min calculated when
there already exists a CIG can be larger than peer's
cis_offset_min being negotiated.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* tracing: sysview: implement RTT channel selection through KConfig

Implement Kconfig value for selecting the RTT channel to be used
by Segger SystemView

Signed-off-by: Nathan Olff <[email protected]>

* tracing: sysview: implement SEGGER_SYSVIEW_APP_NAME

Implement APP_NAME define in Kconfig for Segger SystemView module.
Use APP_NAME in Systemview initialization function

Signed-off-by: Nathan Olff <[email protected]>

* sysbuild: Fix value propagation of signature type to MCUboot

Fixes an issue whereby the type of the signature was not passed
to MCUboot.

Signed-off-by: Jamie McCrae <[email protected]>

* templates: change template file namaes for proper sorting

prefix with numbers to get sorting based on usage. Most common files
issue types should come first, with bugs being at the top.

Signed-off-by: Anas Nashif <[email protected]>

* ci: testplan: do not start more runners than needed

We have been launching 10 runners up a certain number of tests, although
we only neeed half of that for some scenarios.
Too many runners started that have to execute just a small number of
tests wastes times on setup and blocks the queue. Just start the number
of nodes needed based on initial calculation.

Signed-off-by: Anas Nashif <[email protected]>

* tests: drivers: dac channel structure has a buffered parameter boolean

Add the '.buffered' field to the dac_channel_cfg structure
when testing the DAC.
This boolean parameter is initialised to 'true' to PASS the test.
It follows the https://github.com/zephyrproject-rtos/zephyr/pull/57730
Also changed for the samples/drivers/dac

Signed-off-by: Francois Ramu <[email protected]>

* Bluetooth: Host: Set valid default for secondary adv phy

Set the secondary advertising PHY to a valid value when using
legacy advertising through the LE Set Extended Advertising Parameters
command.

Fixes #57885.

Signed-off-by: Carles Cufi <[email protected]>

* tests: bluetooth: tester: Fix ATT max attr size assert

ATT attributes can be up to 512 bytes long, so the comparisong needed
fixing.

See spec v5.4, Vol 3, Part F, 3.2.9.

Fixes #57930.

Signed-off-by: Carles Cufi <[email protected]>

* arch: arm64: Use atomic for fpu_owner pointer

Currently the lazy fpu saving algorithm in arm64 is using the fpu_owner
pointer from the cpu structure to understand the owner of the context
in the cpu and save it in case someone different from the owner is
accessing the fpu.

The semantics for memory consistency across smp systems is quite prone
to errors and reworks on the current code might miss some barriers that
could lead to inconsistent state across cores, so to overcome the issue,
use atomics to hide the complexity and be sure that the code will behave
as intended.

While there, add some isb barriers after writes to cpacr_el1, following
the guidance of ARM ARM specs about writes on system registers.

Signed-off-by: Luca Fancellu <[email protected]>

* tests: drivers: dac loopback on stm32 boards fix pinout

Change the pinout for ADC/DAC loopback testing on the stm32 boards
nucleo_l073rz: adc_in0_pa0/dac_out1_pa4 --> A0 to A2 on arduino CN8
nucleo_g071rb: adc1_in0_pa0/dac1_out1_pa4 --> A0 to A2 on arduino CN8
stm32l562e_dk: adc1_in13_pc4/dac1_out1_pa4 --> A2 to A4 on arduino CN19
Adjust the ACQuisition time to the MAX value because the default (=0)
is too low for several boards.

Signed-off-by: Francois Ramu <[email protected]>

* manifest: bsim: Do not import but replicate in main manifest

Due to a limitation in the west import feature,
a project cannot both have an import and be part of a group.
Moreover, when a project has an import and is not filtered
out, it is required for that project to be present
for most west commands to work.

As the bsim project is not filtered by default,
it causes trouble for users who never run a
west update but try to use west further.

To work around this issue, let's disable the import
in the bsim project, and instead replicate its content
inside Zephyr's main manifest.

Having a replica of the babblesim manifest content
is likely to cause some confusion in users,
wrt to which version of components they are using.
So whenever west supports both imports and groups, or another
simple and nicer way of working around this, it should be used.

Signed-off-by: Alberto Escolar Piedras <[email protected]>

* Revert "ci: doc-build: Pull 'bsim' west project"

This reverts commit 00130b72ceb8a68aee2faa564e7107a5fc56deb2.

Signed-off-by: Alberto Escolar Piedras <[email protected]>

* CI: bsim workflow: Fix getting bsim revision

As the bsim repo is disabled by default, west list bsim -f {sha}
fails.
Instead get the revision field which works.

Signed-off-by: Alberto Escolar Piedras <[email protected]>

* Bluetooth: MPL: Modify parse_search to use bt_data_parse

Modify the implementation of parse_search to use a
net_buf_simple and bt_data_parse to parse the LTV
search structure.

Signed-off-by: Emil Gydesen <[email protected]>

* Bluetooth: Shell: On disconnect set new default_conn

When a device disconnects we previously just unref'ed it and
set default_conn = NULL. However, if we are connected to mulitple
devices, it makes sense to set the default_conn to one of the
other connections.

Signed-off-by: Emil Gydesen <[email protected]>

* ARC: SMP: fix livelock in thread abort due to exception

We are missing setting of switch_handle for the thread which
is aborting due to exception (i.e. in case of k_panic or
__ASSERT triggered). This may cause livelock in SMP code
after a08e23f68e03 commit ("kernel/sched: Fix SMP
must-wait-for-switch conditions in abort/join").

Fix that.

Signed-off-by: Eugeniy Paltsev <[email protected]>
Signed-off-by: Evgeniy Paltsev <[email protected]>

* stm32g4: adc345: set resolutions & sampling-times in dtsi

bring back adc3/4/5 with latest "st,stm32-adc" required
properties: resolutions & sampling-times

Signed-off-by: Cyril Fougeray <[email protected]>

* tests: Bluetooth: Split CAP initiator tests to unicast and broadcast

Split the cap_initiator_test.c to two new files
cap_initiator_broadcast_test.c and
cap_initiator_unicast_test.c as the two barely had any
common functionality, and the file was getting too large.

Signed-off-by: Emil Gydesen <[email protected]>

* samples: Bluetooth: hci_usb: Disable USB_CDC_ACM

BlueZ btusb does not recognize hci_usb sample as Bluetooth
Controller when CDC ACM is enabled in the sample.

Refer to https://github.com/zephyrproject-rtos/zephyr/issues/29107

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* shell: Fix shell_vfprintf when vt100 is disabled

Without this fix, for every call to shell_vfprintf,
a prompt string and vt100 codes are printed too,
resulting in mangled log output.

Signed-off-by: Lars Knudsen <[email protected]>

* drivers: usb_dc_native_posix: Check data length before copy

Fail requests if the data does not fit inside buffer.

This commit only adds missing sanity checks but the native posix driver
remains broken at the design level. The amount of work to fix the native
posix driver in legacy USB stack is deemed too great to be worth it.

Coverity-CID: 195841, GitHub issue #58564
Coverity-CID: 240244, GitHub issue #58570

Signed-off-by: Tomasz Moń <[email protected]>

* drivers: usb_mcux: Fix disable and reset functions

1. Fix the reset function to reset correctly.
2. Ensure the controller handle is initialized before
   calling the SDK functions.

Signed-off-by: Mahesh Mahadevan <[email protected]>

* riscv: Rename Kconfig symbol to *_PRIVILEGED

Rename SOC_FAMILY_RISCV_PRIVILEGE to SOC_FAMILY_RISCV_PRIVILEGED because
the spec is "privileged".

Signed-off-by: Carlo Caione <[email protected]>

* riscv: Move directory to *-privileged

Because the spec is "privileged" not "privilege".

Signed-off-by: Carlo Caione <[email protected]>

* posix: pthread: reimplement pthread_barrier using zephyr objects

Previously pthread_barrier_t was implemented in terms of wait
queues and internal scheduler functions.

This introduced some obstacles and inconsistency. In order
to be more consistent, rely only on Zephyr's public API and
reuse as many concepts as possible.

Deprecate `PTHREAD_BARRIER_DEFINE()` since it's non-standard.

Signed-off-by: Christopher Friedt <[email protected]>

* posix: mutex: use k_mutex instead of posix_mutex

The internal representation of `pthread_mutex_t`,
`struct posix_mutex`, is basically a clone of `struct k_mutex`
but without the benefit of being able to use all of the
existing `k_mutex_*()` suite of functions.

The first step in the right direction was switching
the external representation of `pthread_mutex_t` to a simple
`int`. Let's take the next step in the right direction, which
is getting rid of `struct posix_mutex`.

The only significant difference between `struct k_mutex` and
`struct posix_mutex` is that the latter needs a `type` field.

Since there were a fixed number of `struct posix_mutex`, we
can just externalize the `type` field and reuse
`struct k_mutex` as-is.

For now, let's keep this change as a simple type
substitution. Eventually, we should be able to fully switch
to Zephyr API internally.

Signed-off-by: Christopher Friedt <[email protected]>

* posix: cond: use k_condvar instead of posix_cond

The internal representation of `pthread_cond_t`,
`struct posix_cond`, is an identical clone of `struct k_condvar`
but without the benefit of being able to use all of the
existing `k_condvar_*()` suite of functions.

The first step in the right direction was switching
the external representation of `pthread_cond_t` to a simple
`int`. Let's take the next step in the right direction, which
is getting rid of `struct posix_cond`.

For now, let's keep this change as a simple type
substitution. Eventually, we should be able to fully switch
to Zephyr API internally.

Signed-off-by: Christopher Friedt <[email protected]>

* posix: pthread: rework pthreads to use zephyr api

Previously, pthreads suffered from some race conditions.
This was almost inevitable given that it was maintained in
parallel to Zephyr's threading and synchronization API.

The unfortunate side-effect of with that is that it did not
receive the reliability and other improvements that
`k_thread`s did.

Here, we perform a significant update of pthread code so
that it depends directly on public Zephyr API. With that,
we reuse as many concepts as possible and pthreads benefits for
free from any improvement made to Zephyr's threading and
synchronization APIs.

Included with this change, we
* implement state with `ready_q`, `run_q`, and `done_q`
* use `pthread_barrier_wait()` to sync `pthread_create()`
* synchronize internal state with a spinlock

These pthreads are considerably more reliable than
before.

Signed-off-by: Christopher Friedt <[email protected]>

* posix: pthread: add option for pthread_create() barrier

To enable testing, introduce `CONFIG_PTHREAD_CREATE_BARRIER`.

Some observations were made that running several Qemu SMP targets
concurrently could lead to synchronization problems. On such
targets, it was found that the synchronization issues were
mitigated by introducing a `pthread_barrier_t` shared between
`pthread_create()` and the spawned thread.

It is suggested to enable the option when running many
SMP tests concurrently in several parallel Qemu processes,
e.g. with `twister`.

Signed-off-by: Christopher Friedt <[email protected]>

* tests: posix: improvements to pthread_pressure test

* allow `qemu_cortex_a53`
* disallow `qemu_leon3
* remove `TEST_DURATION_S` range
* additional report formatting

Signed-off-by: Christopher Friedt <[email protected]>

* posix: pthread: mitigate include order sensitivity

Previously, the `posix_internal.h` header needed to be exposed
to the application because we had non-trivial details for
most posix types (pthread, mutex, cond, ...). Since most of
those have been simplified to a typedef'ed integer, we
no longer need to expose that header to the applicaiton.

Additionally, it means that we can adopt normalized
header order in posix.

Additionally, keep more implementation details hidden
and prefer the static keyword on internal symbols where
possible.

Signed-off-by: Christopher Friedt <[email protected]>

* doc: release: 3.4: add posix api release notes

Add POSIX API release notes for v3.4.0.

Signed-off-by: Christopher Friedt <[email protected]>

* doc: release: 3.4: Add notes about Atmel

Add 3.4.0 release notes for Atmel.

Signed-off-by: Gerson Fernando Budke <[email protected]>

* doc: release: 3.4: Add notes about Gigadevices

Add 3.4.0 release notes for Gigadevices

Signed-off-by: Gerson Fernando Budke <[email protected]>

* drivers: auxdisplay: Fix jhd1313 compilation issues

Added several missing undeclared config variables causing the driver to
not compile properly.
Fixes #59078.

Signed-off-by: Benjamin Cabé <[email protected]>

* drivers: auxdisplay: Fix text direction handling

Fixed Input Set handling.
Flag had misleading names: whether "entry" happens to the left or to the
right is dependent on whether increment mode is active or not), so
switched to just using a "SHIFT" y/n flag instead. It also reflects better
the contents of the datasheet).
Updated romance text direction accordingly ("increment, no shift").

Signed-off-by: Benjamin Cabé <[email protected]>

* drivers: auxdisplay: Set background to white

Fixed inconsistency between code & comments and actually set
background to black

Signed-off-by: Benjamin Cabé <[email protected]>

* drivers: auxdisplay: Fix rows/columns inversion

JHD1313 is 16 columns x 2 rows.

Signed-off-by: Benjamin Cabé <[email protected]>

* Bluetooth: ISO: Log status as hex instead of decimal

Log status values in events as hex instead of decimal
to make it easier to compare to the spec and hci_err.h

Signed-off-by: Emil Gydesen <[email protected]>

* Samples: iso_connected_benchmark: Use BT_LE_ADV_OPT_ONE_TIME

It is not intentional to continue advertising once a connection has been
established for two reasons:
 1. We do not configure enough connection contexts for this
 2. We don't want to generate controller scheduling conflicts that can
    possibly reduce performance.

Signed-off-by: Rubin Gerritsen <[email protected]>

* Samples: iso_connected_benchmark: Fix invalid latency

The default transport latency was not valid.
Set it to a value that is large enough.
The minimum possible transport latency is 16580 us,
but this assumes the controller ignores the RTN=2.
If the controller uses the RTN=2, the transport latency will
be slightly larger than 30 ms depending on
how the controller chooses to setup the ISO link.

Therefore, we set it to 40 ms to ensure the default
configuration is valid.

How these numbers were found:

For unframed PDUs this is defined in Core_v5.4, Vol 6,
Part G, Section 3.2.2:
  Transport_Latency =
    CIG_Sync_Delay + FT * ISO_Interval - SDU_Interval

Because unframed PDUs are being used, the ISO interval needs
to be a multiple of SDU interval.
If MaxPDU = MaxSDU and the PHY is 2M, this results in that
the maximum subevent size is:
2120 * 2 + 2 * 150 = 4540.
For 2 CISes this is 9080 us > 7500
Therefore, the controller has to set the ISO interval to a
minimum of 15000 us in order to fit the packets.

Based upon this info, the controller has the freedom to ignore
or use the requested RTN=2.
1. Ignore -> NSE is 2: Minimum ISO interval is 15000 us
2. RTN = 2, Increase NSE: 4 * 4540 = 18160 -> ISO_Interval = 22500 us
3. RTN = 2, Increase the FT to 2, NSE = 2 -> ISO_Interval = 15000 us

For (1):
  Transport_Latency = CIG_Sync_Delay + 15000 - 7500
                    = CIG_Sync_Delay + 7500
For (2):
  Transport_Latency = CIG_Sync_Delay + 22500 - 7500
                    = CIG_Sync_Delay + 15000
For (3):
  Transport_Latency = CIG_Sync_Delay + 2 * 15000 - 7500
                    = CIG_Sync_Delay + 22500

As shown in Core_v5.4, Vol 6, Part B, Section 4.5.14,
CIG_Sync_Delay needs to be larger than or equal to the length of
all ISO events. That is, the sum of the subevents:

For (1): CIG_Sync_Delay = 2 * 4540 = 9080
For (2): CIG_Sync_Delay = 4 * 4540 = 18160
For (3): CIG_Sync_Delay = 2 * 4540 = 9080

This results in the following transport latencies:

For (1): Transport_Latency = 9080 + 7500 = 16580
For (2): Transport_Latency = 18160 + 15000 = 33160
For (3): Transport_Latency = 9080 + 22500 = 31580

Signed-off-by: Rubin Gerritsen <[email protected]>

* doc: release notes: add 1-wire release notes for 3.4.0

Add 1-Wire related release notes for Zephyr v3.4.0.

Signed-off-by: Thomas Stranger <[email protected]>

* ARC: Fix portability.posix.common.arcmwdtlib test

portability.posix.common.arcmwdtlib test fails with ARCMWDT libc.
This path fixes the test.

STDIN_FILENO and others macroses are used in libc-hooks.c only. So they
defined localy.

Signed-off-by: Nikolay Agishev <[email protected]>

* Bluetooth: BAP: Remove bad log error from bt_audio_valid_codec

There was a LOG_ERR from debugging.

Signed-off-by: Emil Gydesen <[email protected]>

* Bluetooth: BAP: modify when ASCS disconnects the CIS

When an audio stream in a bidirectional CIS is released,
it should not disconnect the CIS if there is still a stream
for the opposite direction streaming. Only if both streams
are not in a streaming state, should ASCS attempt to disconnect
the CIS.

Signed-off-by: Emil Gydesen <[email protected]>

* Bluetooth: BAP: Release stream on codec config if requested

An ASCS endpoint may go into either the idle or codec configured
state when a stream is released. However since we have such a high
coupling between audio streams and endpoints, we need to consider
the endpoint as having been released (i.e. gone to the IDLE state).

This is handled by a boolean state variable for now, but we may
want to consider a more generic approach where streams and
endpoints may be less coupled.

Signed-off-by: Emil Gydesen <[email protected]>

* Bluetooth: CAP: Add Initiator cancel procedure

Add function to cancel any current proecedure. This is useful
in cases where the connection to one or more acceptors is lost
or if some acceptor does not respond to our requests for whatever
reason.

Signed-off-by: Emil Gydesen <[email protected]>

* Bluetooth: CAP: Shell: Add cmd_cap_initiator_unicast_cancel

Add cmd_cap_initiator_unicast_cancel to call the cancel
function.

Signed-off-by: Emil Gydesen <[email protected]>

* tests: Bluetooth: CAP: Add bsim test for unicast_audio_cancel

Add test of the unicast audio cancel that can cancel any pending
procedures. This is done by adding a new blocking behavior in the
cap acceptor.

Signed-off-by: Emil Gydesen <[email protected]>

* tests: Bluetooth: CAP: BSIM: Set initiator as d=0 and acceptor as d=1

Typically the client is the first device in our babblesim tests, so
reordered the initiator and acceptor for the CAP tests to conform to
that.

Signed-off-by: Emil Gydesen <[email protected]>

* Bluetooth: Audio: Shell: Increase number of streams for unicast client

Increase CONFIG_BT_BAP_UNICAST_CLIENT_GROUP_STREAM_COUNT to match
CONFIG_BT_ISO_MAX_CHAN.

Signed-off-by: Emil Gydesen <[email protected]>

* doc: services: posix: update posix supported items

Several items needed to be updated in POSIX documentation.

* add `_POSIX_BARRIERS` top Option Requirements
* update `_POSIX_THREAD_ATTR_STACK*` in Option Requirements
* add `pthread_barrier_*()` to `POSIX_THREADS_BASE`
* update `pthread_cond_destroy()` and `pthread_setcancelstate()`

Signed-off-by: Christopher Friedt <[email protected]>

* shell: Fix BT verbose scan logging

Fix endianness printout of values.

Handle service data output with initial UUID.

Signed-off-by: Lars Knudsen <[email protected]>

* doc: services: posix: update c-lang support section

Several C language items have gained support in Zephyr over
time.

Signed-off-by: Christopher Friedt <[email protected]>

* release: bump release to 3.4.0-rc3

Bump release to 3.4.0-rc3.

Signed-off-by: Anas Nashif <[email protected]>

* doc: release: 3.4: add posix api deprecations

Add POSIX API deprecations to v3.4 release notes.

Signed-off-by: Christopher Friedt <[email protected]>

* Bluetooth: Rework the HCI header set

In order to have clean, self-contained HCI headers that do not have any
dependencies towards the Host or any other part of the system (except
types), reorganize the headers in the following way:

- Split out the macros and structs from hci.h to a new hci_types.h
- Merge the existing hci_err.h into the new hci_types.h

Fixes #58214.

Signed-off-by: Carles Cufi <[email protected]>

* Bluetooth: Controller: Rework internal header includes

Rework internal header files to not have includes, rather
have the required includes in the c source files.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* doc: release-notes/3.4: add bits for UART

This adds bits for various additions and fixes on UART
drivers.

Signed-off-by: Daniel Leung <[email protected]>

* doc: release-notes/3.4: small bit about PCIe

Added a small bit about PCIe where it can now filter
using class/revision register.

Signed-off-by: Daniel Leung <[email protected]>

* doc: release-notes/3.4: bits on Xtensa

This adds a few bits on additions and changes on Xtensa.

Signed-off-by: Daniel Leung <[email protected]>

* doc: release: 3.4: Add POSIX arch and POSIX boards changes

Add points related to the POSIX arch and boards to the
3.4 release notes.

Signed-off-by: Alberto Escolar Piedras <[email protected]>

* doc: release: 3.4: Add more flash simulator changes

Add some extra relevant changes to the flash simulator

Signed-off-by: Alberto Escolar Piedras <[email protected]>

* doc: release: 3.4: Add BabbleSim related points

Add relevant bsim related changes.

Signed-off-by: Alberto Escolar Piedras <[email protected]>

* doc: release: 3.4: Fix indent in ARCH's lists

So they render properly.

Signed-off-by: Alberto Escolar Piedras <[email protected]>

* doc: release-notes: add CAN release notes for v3.4.0

Add CAN related release notes for Zephyr v3.4.0.

Signed-off-by: Henrik Brix Andersen <[email protected]>

* sysbuild: Fix exporting BOARD.+ through sysbuild cache

Lately, sysbuild started filtering out variable names matching ^BOARD
during sysbuild cache file generation. As a result, one of the cache
variables that is no longer exported to other domains is BOARD_ROOT,
which breaks the recent support for out-of-tree boards in sysbuild.

Of those variables, the only one which is reasonable to filter out is
BOARD itself, because the purpose of that is to substitute a different
value for the one found in sysbuild's own CMake cache, which has the
board revision stripped out.

Update the relevant if-condition and use a single regex for brevity.

Fixes #59114.

Signed-off-by: Grzegorz Swiderski <[email protected]>

* Bluetooth: Controller: Fix disable all advertising sets

BlueZ stack in Linux distributions use disable all
advertising sets when advertising is turned off.

Add missing implementation to support disabling all
active advertising sets.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* drivers: can: mcan: remove excessive debug on register access

Remove excessive debug output on Bosch M_CAN register access. This was
accidentially included in commit bbfc1f905c2d19c70b6138d8e5851870d01812e1.

Signed-off-by: Henrik Brix Andersen <[email protected]>

* net: l2: ethernet: Fix IPv6 Kconfig

Function net_if_ipv6_addr_rm is only defined for NATIVE_IPV6.

Signed-off-by: Chaitanya Tata <[email protected]>

* Revert "net: context: Fix ambigous pointer check in net_context_connect()"

This reverts commit 22b889e3b49def0a6423203581596076d2ef9c38.

Signed-off-by: Robert Lubos <[email protected]>

* net: context: Verify that laddr was set before use in connect

In previous patch fixing this issue, I've missed the fact that offloaded
drivers would not set the context->local address, which resulted in a
regression, where the previously introduced assert would hit in
offloaded cases. Not setting laddr is not a problem in case of
offloading, as it's only used in net_tcp_connect() which would not be
reached in this case.

Therefore I propose to remove previous patch to get rid of regression.
As an alternative fix, verify the laddr just before use, so that it is
only checked when native net stack is in use.

Signed-off-by: Robert Lubos <[email protected]>

* drivers: uart_mcux_flexcomm: Unlock IRQ if error

Currently the flexcomm uart driver will not unlock IRQ
if there is an error, which might cause some problems, fix this.

Signed-off-by: Declan Snyder <[email protected]>

* tests: timer_behavior: Use bigger drift tolerance for nRF RTC timer

Use 13% instead of the default 10% when the nRF RTC timer is used
so that the allowed drift is at least one tick long (~122 us in
this case).

Signed-off-by: Andrzej Głąbek <[email protected]>

* tests: timer_api: Decrease tick rate for nRF RTC timer

The default tick rate for the nRF RTC timer is 32768 Hz, so one tick
is ~30 us. This turns out to be too little for the following loop
executed in user mode on the Network core in nRF5340:
```
	do {
		t0 = k_uptime_ticks();
		rem_ticks = k_timer_remaining_ticks(&remain_timer);
		t1 = k_uptime_ticks();
	} while (t0 != t1);
```
The time between the two calls to `k_uptime_tick()` is there always
above 30 us, so the loop never ends.

This patch decreases the tick rate for all nRF platforms because on
other nRf SoCs the time mentioned above is also close to 30 us and
apparently changes in code completely unrelated to this test affect
execution time of system calls in the above loop - the test started
to fail after commit 0014dd05f017c167827bf0e10846b641727b7a18 that
changes fdtable was merged and if `fdtable.c` is for example just
temporarily excluded from the build, the test passes.

The root cause of the problem seems to be related to user space
handling and this should to be investigated further. This patch
is applied only to allow this test to pass for the time being.

Signed-off-by: Andrzej Głąbek <[email protected]>

* tests: posix: pthread_pressure: enable pthread barrier in twister

In some cases, when GitHub CI is running several Qemu processes,
each with heavy loads, SMP tests have shown some flakiness. This
exhibits itself as something like

```
... pthread_pressure on qemu_riscv32 failed (Timeout)
```

That is actually not at all limited to POSIX or any particular
architecture, but is mainly to do with the host scheduler and
perhaps memory barrier operations being lost in ISA translation
by Qemu.

Collectively, we can refer to these issues as "scheduler noise".

To reduce scheduler noise in the `pthread_pressure` testsuite,
enable `CONFIG_PTHREAD_CREATE_BARRIER` in `testcase.yaml`.

Note: end-users will likely not experience the need to enable
this in `prj.conf`. E.g. the following basic test demonstrates
0 failures locallly.

```
TEST=tests/posix/pthread_pressure
twister --build-only -T $TEST &>/dev/null
FAIL=0
for ((i=0; i < 100; i++)); do
  echo "Run $((i+1))/100"
  twister --test-only -T $TEST &>/dev/null
  if [ $? -ne 0 ]; then
    FAIL=$((FAIL+1))
    echo "Failed $FAIL times"
  fi
done
echo "Failure Rate: $((FAIL))/100"
```

Signed-off-by: Christopher Friedt <[email protected]>

* drivers: gpio: pca95xx: check gpio_add_callback() return value

Check the return value from gpio_add_callback() and fail driver
initialization if non-zero.

Fixes: #58584

Signed-off-by: Henrik Brix Andersen <[email protected]>

* drivers: pwm: pwm_mcux: improve resolution by writing match register

Write PWM match registers directly instead of using the frequency and
duty cycle fields of the MCUX HAL driver. This allows the driver to take
full advantage of the resolution supported by the FlexPWM when setting
duty cycle and carrier frequency.

Fixes #59080

Signed-off-by: Daniel DeGrasse <[email protected]>

* drivers/clock_control: SAM PMC missing soc.h

The source clock_control_sam_pmc.c can not build without the
symbol SOC_ATMEL_SAM_MCK_FREQ_HZ which is contained in soc.h

This bug only shows itself if CONFIG_ARM_MPU is not enabled,
which probably includes soc.h through the <zephyr/arch/cpu.h>
which is not desired behavior.

This commit adds the missing header, making the source build
regardless of CONFIG_ARM_MPU.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>

* net: lib: zperf: fix kernel panic due to invalid thread prio

Compiling an application with CONFIG_NET_ZPERF=y leaving
CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY at its default value would
systematically cause a kernel panic during thread initialization.

The Kconfig variable is NUM_PREEMPT_PRIORITIES by default. Application
threads may not define a priority lower than NUM_PREEMPT_PRIORITIES - 1,
though.

This change limits zperf's thread priority to a valid range. It does not
change the default value as it makes sense to default the thread
priority to the lowest possible value (which is NUM_PREEMPT_PRIORITIES)
but Kconfig does not allow for arithmentic. So the combination of
CLAMP() plus the Kconfig default will ensure min priority plus limit the
range to valid values no matter what has been defined as priority in
Kconfig.

Fixes: #59141

Signed-off-by: Florian Grandel <[email protected]>

* net: l2: ieee802154: shell: fix printing ext addr

A bug was introduced in one of my earlier commits: The shell does no
longer print the full extended address. Fixes the issue.

Fixes: #59125

Signed-off-by: Florian Grandel <[email protected]>

* net: l2: ieee802154: fix buffer pointer ref

The uncast reference caused a cbprintf() warning on the console.

Fixes: #59125

Signed-off-by: Florian Grandel <[email protected]>

* Revert "drivers: serial: ns16550: Add support for Async APIs"

This reverts commit 2d03aaf99f326ec0c916da1ca7b8725c8b9fdbc8.

The async API for NS16550 is incomplete. We are near the next
release so it is better to revert it for now, and a proper
correct implementation can be done before next-next release.

Relates to #57103

Signed-off-by: Daniel Leung <[email protected]>

* Bluetooth: TBS: Ensure that inst exist when notifying terminate

When calling the `terminate_call` the `inst` would always be NULL
as we had just terminated the call that we attempted to look up.

Signed-off-by: Emil Gydesen <[email protected]>

* drivers: pinctrl_emsdp: add dummy mux for unmuxed peripheral

ARC EMSDP board has some peripherals are internal connected,
such as DW spi1 and DFSS i2c0. They are unmuxed and have fix
connection to spi-flash or sensor. For these peripheral, add
dummy mux type to avoid pinctrl ENOENT error.

Signed-off-by: Siyuan Cheng <[email protected]>

* drivers: pinctrl_emsdp: fix definition location

Mux Control Register Index are internals of driver, now
moved from dt-binding header to driver itself.

Signed-off-by: Siyuan Cheng <[email protected]>

* usb: device: class: rndis: Limit response length

Prevent potential buffer overflow when encapsulated response is more
than CONFIG_USB_REQUEST_BUFFER_SIZE. Log error and truncate response if
USB control transfer request buffer is not large enough.

Signed-off-by: Tomasz Moń <[email protected]>

* Bluetooth: Mesh: Fix printing UUID log message

CONFIG_BT_MESH_PROV_DEVICE_LOG_LEVEL_INF may not be present while
CONFIG_BT_MESH_PROV_DEVICE_LOG_LEVEL is always present.

Signed-off-by: Pavel Vasilyev <[email protected]>

* Bluetooth: Mesh: Print UUID with correct endianess

bt_uuid_str expects UUID in little endian while UUID encoded into
unprovisioned mesh beacon is encoded in big endian. sys_memcpy_swap will
change endianess of uuid so that bt_uuid_str can be used.

Signed-off-by: Pavel Vasilyev <[email protected]>

* tests: bluetooth: mesh_shell: Print correct command for provisioning

Provisioning commands were moved under `mesh prov` subcommand.

Signed-off-by: Pavel Vasilyev <[email protected]>

* net: coap: CoAP reply handler fix

Fix corner case when client RX request with same token than
own request where it wait responses.

Signed-off-by: Juha Heiskanen <[email protected]>

* arch: arm64: cache: fix usage of extern C linkage specification

Reorder preprocessor condition endings in arm64/cache.h,
this eliminates the breaking of the 'extern "C"' construction.

Signed-off-by: Mykola Kvach <[email protected]>

* Shell: Add missing long long type in shell_strtoull

shell_strtoull used a unsigned long instead of a unsigned
long long to store the result in stroull, so the return
value may have been truncated.

Signed-off-by: Emil Gydesen <[email protected]>

* mgmt: mcumgr: fs_mgmt: Fix duplicate bool ok variables

Fixes wrongly declaring duplicate local variables that already
exist and hiding the previous variables definitions.

Signed-off-by: Jamie McCrae <[email protected]>

* doc: services: device_mgmt: mcumgr: Update callback documentation

Updates and fixes callback documentation to show functionality and
definitions that were recently updated.

Signed-off-by: Jamie McCrae <[email protected]>

* modules: lvgl: define the Kconfig types used in boards

Some boards override default for few LVGL LV_Z_* symbols. This causes
the build to fail if the module is not present in the system, and has
been worked around on one board by repeating the types in the board
Kconfig file.

Fix this properly by defining the known type for all symbols used in
boards in modules/Kconfig.lvgl.

Signed-off-by: Fabio Baltieri <[email protected]>

* modules: lvgl: replace LV_Z_DPI with LV_DPI_DEF

It looks like LV_Z_DPI is not used anywhere and only lived in the
context of an incorrect board symbol definition so far (moved to
Kconfig.lvgl in the previous patch).

This was probably meant to be LV_DPI_DEF (which actually exists in the
LVGL module) and was renamed incorrectly, fix it by renaming it
everywhere.

Signed-off-by: Fabio Baltieri <[email protected]>

* net: wifi_mgmt: Pass address instead of value as pointer

Fix for not getting expected event information at application.
net_mgmt_event_notify_with_info() expects the address
not the value as pointer.

Signed-off-by: Ajay Parida <[email protected]>

* gcc/target.cmake: fix build with gcc-13

Configuration error:
| -- Configuring done (4.9s)
| CMake Error in CMakeLists.txt:
|   Target "zephyr_interface" contains relative path in its
|   INTERFACE_INCLUDE_DIRECTORIES:
|
|     "include-fixed"

With GCC-13, limits.h and syslimits.h header files
are always being installed to include folder.
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=be9dd80f933480

Signed-off-by: Naveen Saini <[email protected]>

* release: relnotes: Add Bluetooth release notes for 3.4.0

As usual, populate the Bluetooth release notes.

Signed-off-by: Carles Cufi <[email protected]>

* release-notes: v3.4: Document STM32 changes

Document STM32 related changes on V3.4 release.

Signed-off-by: Erwan Gouriou <[email protected]>

* release-notes: v3.4: Document shield additio…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DAC Digital-to-Analog Converter area: Devicetree Binding PR modifies or adds a Device Tree binding platform: STM32 ST Micro STM32 Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants